
clear all
clear mata
clear matrix
set more off
set scheme modern

*set path here*

global rawdata = 
global workingdata = 
global match = 
global temp = 
global table = 

*****************************************************
*generate an indicator for cooler and hotter regions*
*****************************************************

use $match\weather.dta, clear

gen year=year(day)
gen month=month(day)

keep if year>=2010&year<=2018
keep if month>=7&month<=8

collapse (mean) temp,by(countyid)

astile temp_group=temp, nq(2)

keep countyid temp_group

save $match\temp_group.dta, replace
